Technical Field
The present invention relates to 3D (three-dimensional) graphics, and in particular, it relates to methods for checking dependencies of data units and apparatuses using the same.
Description of the Related Art
In a 3D graphics pipeline, the rasterizer converts primitives into pixels and feeds these pixels into the pixel shader. The pixel shader determines the final pixel color to be written to the render target. The rasterizer generates primitives in order and tiles for each primitive. The data units (e.g. quads) are abstracted and packed to threads. One thread contains a predefined number of data units. The threads are kicked off into the pixel shader and run in parallel. The threads run in the pixel shader may be out of order. But, the pixel shader needs to output data units in the order generated by the rasterizer. The threads, when being executed, may be arbitrary access memory, such as read data, write data, etc. However, a read-after-write hazard may occur for the same data unit between threads. To avoid the aforementioned problem, it is desirable to provide methods for checking dependencies of data units and apparatuses using the same.